package com.songlanyun.modules.personaldata.controller.api;

import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;
import com.songlanyun.common.validator.ValidatorUtils;
import com.songlanyun.common.validator.group.AddGroup;
import com.songlanyun.modules.personaldata.entity.PersonalDataEntity;
import com.songlanyun.modules.personaldata.service.PersonalDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;


/**
 * 关于我们-个人资料
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-03-30 14:34:07
 */
@RestController
@RequestMapping("api/personal/data")
public class PersonalDataApiController {
    @Autowired
    private PersonalDataService personalDataService;

    /**
     * 保存
     */
    @PostMapping("/save")
    //@RequiresPermissions("personaldata:personaldata:save")
    public R save(@RequestBody PersonalDataEntity personalData) {
        ValidatorUtils.validateEntity(personalData, AddGroup.class);
        personalDataService.saveData(personalData);

        return R.ok();
    }

}
